package com.scs.application.modules.sys.dto;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @Description:流程DTO
 */
@Data
@Accessors(chain = true)
public class FlowDTO {

    @JSONField(ordinal = 0)
    private String id;

    @JSONField(ordinal = 1)
    private String code;

    @JSONField(ordinal = 2)
    private String name;

    @JSONField(ordinal = 3)
    private String fieldName;

    @JSONField(ordinal = 4)
    private Boolean flagDisable;

    @JSONField(ordinal = 5)
    private String remark;

    @JSONField(ordinal = 6)
    private List<FlowButtonDTO> flowButtons;

    @JSONField(ordinal = 7)
    private List<FlowNodeDTO> flowNodes;

    @JSONField(ordinal = 8)
    private Boolean flagCheckExecution;

    @Data
    @Accessors(chain = true)
    public static class FlowButtonDTO {

        @JSONField(ordinal = 0)
        private String id;

        @JSONField(ordinal = 1)
        private String flowId;

        @JSONField(ordinal = 2)
        private String code;

        @JSONField(ordinal = 3)
        private String title;

        @JSONField(ordinal = 4)
        private String type;

        @JSONField(ordinal = 5)
        private String valueTo;

        @JSONField(ordinal = 6)
        private String valueIf;

        @JSONField(ordinal = 7)
        private String icon;

        @JSONField(ordinal = 8)
        private Boolean flagStart;

        @JSONField(ordinal = 9)
        private Integer sort;

        @JSONField(ordinal = 10)
        private Boolean flagEnd;

        @JSONField(ordinal = 11)
        private Boolean flagComment;

        @JSONField(ordinal = 12)
        private JSONArray roleCodes;

        @JSONField(ordinal = 13)
        private JSONArray userCodes;

        @JSONField(ordinal = 14)
        private String remark;

        @JSONField(ordinal = 15)
        private Boolean flagBatch;

        @JSONField(ordinal = 16)
        private String valueIfTitle;

        @JSONField(ordinal = 17)
        private Boolean flagClose;
        //需要确认
        private Boolean flagConfirm;

       //确认提示
        private String confirmMsg;

        @JSONField(ordinal = 20)
        private Boolean flagBatch2;
    }

    @Data
    @Accessors(chain = true)
    public static class FlowNodeDTO {
        @JSONField(ordinal = 0)
        private String id;

        @JSONField(ordinal = 1)
        private String flowId;

        @JSONField(ordinal = 2)
        private String name;

        @JSONField(ordinal = 3)
        private String value;

        @JSONField(ordinal = 4)
        private String color;

        @JSONField(ordinal = 5)
        private Integer sort;

        @JSONField(ordinal = 6)
        private Boolean flagShowVfbAdd;

        @JSONField(ordinal = 7)
        private Boolean flagShowVfbSave;

        @JSONField(ordinal = 8)
        private Boolean flagShowVfbDelete;

        @JSONField(ordinal = 9)
        private Boolean flagShowVbRefresh;

        @JSONField(ordinal = 10)
        private Boolean flagShowVbAdd;

        @JSONField(ordinal = 11)
        private Boolean flagShowVbDelete;

        @JSONField(ordinal = 12)
        private Boolean flagShowVrbEdit;

        @JSONField(ordinal = 13)
        private Boolean flagShowVrbDelete;

        @JSONField(ordinal = 14)
        private Boolean flagShowVrbView;

        @JSONField(ordinal = 15)
        private JSONArray roleCodes;
    }
}
